//
//  ActivitiViewController.m
//  Cheirapsis
//
//  Created by zhouhaie on 15/11/3.
//  Copyright © 2015年 mohe. All rights reserved.
//

#import "ActivitiViewController.h"
#import "WebViewController.h"
@interface ActivitiViewController (){
    NSArray * arr;

}

@end

@implementation ActivitiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self data];
    self.title = @"商家活动";
    // Do any additional setup after loading the view from its nib.
}


-(void)data{
    arr = @[
            @{
                @"voice":@"商家活动1"
                },
            @{@"voice":@"商家活动2"
              },
            @{@"voice":@"商家活动3"
              },
            @{@"voice":@"商家活动4"
              },
            @{@"voice":@"商家活动5"
              },
            
            ];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




//cell高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 80;
}
////header高度
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//    return 300;
//}
//cell数量
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return arr.count;
}
//绘制cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString *indentifier = @"myCell";
    
    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:indentifier];
    if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indentifier];
        
        
        
        NSDictionary *dic=[arr objectAtIndex:indexPath.row];
        cell.textLabel.text=dic[@"voice"];
        
    }
    
    cell.selectionStyle =UITableViewCellSelectionStyleNone;
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    WebViewController * vc = [[WebViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
